/**
 * 时间：2024年3月6日 11点09分
 * 歌单相关接口
 */
import projectRequest from "./request";
import {
  MusicCollect,
  MusicCollectAddMusicList,
  MusicCollectDetailsListDTO,
  MusicCollectPageDTO
} from "../interface/MusicCollectInterface";

/**
 * 分页查询表单
 * @param params
 */
export function getMusicCollectPageApi(params:MusicCollectPageDTO){
  return projectRequest.request({
    method:"get",
    url:"/musicCollect/page",
    params,
  });
}

/**
 * 获取歌单详情，注意，没有歌曲列表页
 * @param id
 */
export function getMusicCollectDetailsById(id:number) {
  return projectRequest.request({
    method:"get",
    url:`/musicCollect/${id}`
  });
}

/**
 * 获取歌单列表详情，注意：有歌曲列表
 */
export function getMusicCollectDetailsListById(params:MusicCollectDetailsListDTO) {
  return projectRequest.request({
    method:"get",
    url:`/musicCollect/details`,
    params,
  });
}

/**
 * 创建歌单
 * */
export function insertMusicCollectApi(data:MusicCollect) {
  return projectRequest.request({
    url:"/musicCollect/insert",
    method:"post",
    data
  });
}

/**
 * 添加歌单中的音乐列表
 * */
export function insertMusicCollectOfMusicListApi(data:MusicCollectAddMusicList) {
  return projectRequest.request({
    url:"/musicCollectRecord/insert",
    method:"post",
    data
  });
}


